import {api} from "./api";

class Submit {
    async do() {
        // 获取授权小程序
        const apps = await api.getMiniAppList();
        console.log("获取到授权小程序", apps);
        for (const app of apps) {
            if (app.audit_status === 2) {
                console.log("小程序", app.appid, app.app_name, '在审核中', '跳过')
                continue;
            }
            if (app.preview_version.trim() === app.release_version.trim()) {
                console.log("小程序", app.appid, app.app_name, '无需提交审核', '跳过')
                continue;
            }
            await api.submitAudit(app.appid, app.preview_version);
        }
    }
}

(async () => {
    await new Submit().do();
})();
